package services

import "errors"

type IUserService interface {
	GetName(userid int) string
	DelUser(userid int) error
}

type UserService struct{}

func (_ *UserService) GetName(userid int) string {
	if userid == 101 {
		return "user"
	}
	return "admin"
}

func (_ *UserService) DelUser(userid int) error {
	if userid == 101 {
		return errors.New("无权限")
	}
	return nil
}

func NewUserService() IUserService {
	return new(UserService)
}
